
const mongoose = require('mongoose')

const Schema = mongoose.Schema;


const email_code = new Schema({
  type: String,
  email: String,

  code: {
    type: Number,
    default: function (min = 1000, max = 9999)  {
      return Math.floor(Math.random() * (max - min)) + min;
    }
  },

  create_date: {
    type: Date,
    default: new Date(),
  },
})


const Email_code = mongoose.model('Email_code', email_code)

export default Email_code;
